<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head >
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<!-- th:replace="~{common/public::common-public}" -->
              <link th:href="@{/web/css/header.css}" rel="stylesheet">
        <link th:href="@{/web/css/managermain.css}" rel="stylesheet">
        <link th:href="@{/web/css/courseTable.css}" rel="stylesheet">
      <script type="text/javascript" src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<title>Insert title here</title>
    <meta charset="utf-8">
</head>
<body>
    <style>
        .addLesson {
        margin:auto;
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
}

.addLesson-div {
    width: 500px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2);
}

.close {
    position: absolute;
    top: 0;
    right: 0;
    padding: 10px;
    cursor: pointer;
}
           
           
       .form-group {
            margin-bottom: 0px;
        }

        label {
            display: flex;
            font-weight: bold;
            color: #555; /* 设置标签颜色 */
        }

        input[type="text"] {
            width: 100%;
            padding: 10px;
            border: 1px solid #ccc;
            border-radius: 5px;
        }

        button {
            background-color: #007bff; /* 设置按钮背景颜色 */
            color: #fff;
            padding: 10px 20px;
            border: none;
            border-radius: 5px;
            cursor: pointer;
        }
    </style>
<div class="header" th:insert="~{common/kuangjia::header}"></div>
<div class="diceng">
		<div class="caidan">
			<ul>
				<li><a th:href="@{/manong//managermain}">首页</a></li>
				<li><a th:href="@{/manong/getAllCourse}">选课系统</a></li>
				<li><a th:href="@{/manong/gradeManager}">成绩管理</a></li>
				<li><a th:href="@{/manong/active}">活动公告</a></li>
				<li><a th:href="@{/manong/message}">消息中心</a></li>
				<li><a th:href="@{/manong/exit}">退出登录</a></li>
			</ul>
		</div>
		<div class="main">
    <div class="navbar">
<!--     <div>  
    <button id="addBtn" class="addBtn">添加学生</button>
    <div id="addDiv" class="addLesson">
    <div class="addLesson-div">
            <span class="close" id="closeModalBtn">&times;</span>
            <div th:insert="~{web-pages/student-add::add-student}"></div>
        </div>
    </div>
    </div> -->
     <script type="text/javascript" th:inline="javascript">
    
 // modal.js
    document.addEventListener("DOMContentLoaded", function() {
        var addDiv = document.getElementById("addDiv");
        var addBtn = document.getElementById("addBtn");
        var closeBtn = document.getElementById("closeModalBtn");
        var updateDiv = document.getElementById("updateDiv");
        var updateBtn = document.getElementById("updateBtn");
        var closeUpdateBtn = document.getElementById("closeUpdateBtn");
       
        addBtn.addEventListener("click", function() {
            addDiv.style.display = "block";
        });

        closeBtn.addEventListener("click", function() {
            addDiv.style.display = "none";
        });
        updateBtn.addEventListener("click", function() {
        	updateDiv.style.display = "block";
        });

        closeUpdateBtn.addEventListener("click", function() {
            updateDiv.style.display = "none";
        });
    });
</script>
    </div>
    <a class="add-link" th:href="@{/manong/addStudent}">
        <button class="add-button">添加学生</button>
    </a>
    <!-- 添加动画效果到表格 -->
    <table border="1">
        <tr>
            <th th:text="学号"></th>
            <th th:text="姓名"></th>
            <th th:text="性别"></th>
            <th th:text="密码"></th>
            <th th:text="身份证号"></th>
            <th th:text="所属学院"></th>
            <th th:text="专业"></th>
            <th th:text="班级"></th>
            <th th:text="年级"></th>
            <th th:text="籍贯"></th>
            <th th:text="电话号码"></th>
            <th th:text="密保"></th>
            <th th:text="操作"></th>
      
  	</tr>
		    <tr th:each="u:${studentList}">
            <td th:text="${u.sno}"></td>
            <td th:text="${u.sname}"></td>
            <td th:text="${u.sex}"></td>
            <td th:text="${u.password}"></td>
            <td th:text="${u.id}"></td>
            <td th:text="${u.college}"></td>
            <td th:text="${u.speciality}"></td>
            <td th:text="${u.clase}"></td>
            <td th:text="${u.year}"></td>
            <td th:text="${u.nativePlace}"></td>
            <td th:text="${u.phone}"></td>
            <td th:text="${u.confident}"></td>
            <td class="action-links">
                <a th:href="@{/manong/updateStudent(sno=${u.sno})}">修改</a>
                <a th:href="@{/manong/deleteStudent(sno=${u.sno})}" onclick="return confirm('确定要删除吗')">删除</a>
            </td>
        </tr>
    </table>
    </div>
    </div>
    
</body>
</html>




